#include<bits/stdc++.h>

using namespace std;

bool Inc(int x, int y) {
    return x < y;
}

bool Dec(int x, int y) {
    return x > y;
}

int main() {
    vector<int> v = {1, 2, 3, 4};
    cout << binary_search(v.begin(), v.end(), 2) << endl;
    cout << binary_search(v.begin(), v.end(), 2, less<int>()) << endl;
    cout << binary_search(v.begin(), v.end(), 2, Inc) << endl;
    reverse(v.begin(), v.end());
    cout << binary_search(v.begin(), v.end(), 2, Dec) << endl;
    cout << binary_search(v.begin(), v.end(), 2, greater<int>()) << endl;


}